\hypertarget{convection2_8cpp}{
\subsection{Examples/05ConvDiffForced/convection2.cpp File Reference}
\label{convection2_8cpp}\index{Examples/05ConvDiffForced/convection2.cpp@{Examples/05ConvDiffForced/convection2.cpp}}
}


Forced Convection-\/Diffusion in 2D.  




\subsubsection{Detailed Description}
\begin{DoxyAuthor}{Author}
Luis M. de la Cruz \mbox{[} Sat May 23 12:06:36 CDT 2009 \mbox{]}
\end{DoxyAuthor}
\begin{DoxyParagraph}{Description}
This code solves the next equation: \[ \frac{\partial T}{\partial t} + u \frac{\partial T}{\partial x} + v \frac{\partial T}{\partial y} = \frac{\partial T}{\partial x^2} + \frac{\partial T}{\partial x^2} \]. 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
This equation is solved in a unit square $ x, y \in [0,1] $. The velocity is prescribed as follows: \[ u = -A \cos(\pi y) \sin(\pi \lambda x / L_x ); \] \[ v = \frac{A \lambda}{L_x} \sin(\pi y) \cos(\pi \lambda x / L_x); \] The boundary conditions are as shown in the next figure:
\end{DoxyParagraph}
 
\begin{DoxyImage}
\includegraphics[width=10cm]{convection}
\caption{Unit square in 2D}
\end{DoxyImage}


The equation can be solved using Upwind, Central Average (CDS) or QUICK schemes for the approximation of convective terms. CDS and QUICK can be used with {\ttfamily CDS\_\-CoDi} and {\ttfamily QUICK\_\-CoDi}, or with {\ttfamily CDS\_\-Hay} and {\ttfamily QUICK\_\-Hay}. The latter two are the deferred implementation from Hayase et al. 1992, which are more stable.

The results are as presented in the next figure:

 
\begin{DoxyImage}
\includegraphics[width=10cm]{convForced2D01}
\caption{Final result}
\end{DoxyImage}


\begin{DoxyParagraph}{Compiling and running}
Modify the variables BASE and BLITZ in the file {\ttfamily tuna-\/cfd-\/rules.in} according to your installation and then type the next commands: 
\end{DoxyParagraph}
\begin{DoxyParagraph}{}
\begin{DoxyVerb}
   % make
   % ./convection2 \end{DoxyVerb}
 
\end{DoxyParagraph}


Definition in file \hyperlink{convection2_8cpp_source}{convection2.cpp}.

